home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / programm.ing / ams__l~1.zoo / man / fastfont.man < prev    next >
Encoding:
Text File  |  1993-09-05  |  3.5 KB  |  99 lines

  1.                         ATARI MACHINE SPECIFIC LIBRARY
  2.  
  3.  
  4.  
  5. NAME
  6.      FastFont - high speed proportionally space font display
  7.  
  8. SYNOPSIS
  9.      #include <FastFont.h>
  10.  
  11.      class FastFont
  12.  
  13. DESCRIPTION
  14.      Many real-time games and similar applications require a rapidly
  15.      updated on-screen display of text.  This module provides fast
  16.      text display in all bit-plane oriented graphics modes.  The text
  17.      is draw on a single bitplane of the undisplayed doublebuffer page.
  18.  
  19. CLASSES
  20.      A FastFont is a description of a text font that can display
  21.      characters or strings of characters at arbitrary (x,y) positions.
  22.  
  23. CLASS MEMBERS
  24.   FastFont::
  25.  
  26.      FastFont(Screen& s, int w, int h, unsigned char from, unsigned char to)
  27.        Create a font from the graphics on a screen.  The graphics is
  28.        assumed to be a sequence of w-pixel by h-pixel blocks.  The intial
  29.        "width" of each character will be one pixel more than the distance
  30.        from the left side of the character's block, to the right-most
  31.        "on" pixel of the block.  w may be at most 16.  Only the given
  32.        range of characters is extracted from the graphics.
  33.  
  34.      FastFont(const char*)
  35.        Create a font from a previously Saved FastFont.  The file format
  36.        is AMS-specific.  Hopefully, GDOS bitmap fonts will be used later.
  37.  
  38.      int operator! ()
  39.        1 if construction failed, else 0.
  40.  
  41.      int Save(const char*)
  42.        Save the font in an AMS-specific format.  This format may change,
  43.        possibly to the GDOS bitmap font format.
  44.  
  45.      void Plane(short)
  46.        Set the plane on which subsequent Put() operations act.  By default,
  47.        the first bitplane (plane 0) is used.
  48.  
  49.      void Put(char, int& x, int y)
  50.        Put a single character at the given co-ordinates, and advance x by
  51.        the width of that character.  Characters out of the range specified
  52.        at construction are displayed as the first in-range character.
  53.        The text is placed using EXCLUSIVE OR, that is, pixels are "flipped"
  54.        to draw the text, rather than simply set.  This allows for some
  55.        interesting bit-plane effects.  It also allows the text to be
  56.        removed by simply re-Putting it, however other techniques are
  57.        usually faster.
  58.  
  59.      void Put(const char*, int& x, int y)
  60.        As above, except a string of characters is displayed, each separated
  61.        by the current spacing (see SetSpacing() below).
  62.  
  63.      short Width(char)
  64.        Returns the width of the given character.
  65.  
  66.      int Width(const char*)
  67.        Returns the width of the given string of characters, including
  68.        spacing between each.
  69.  
  70.      void SetWidth(char,short)
  71.        Set the width of the given character for kerning purposes (does
  72.        not effect character image).  By default, each character is the
  73.        width of "on" pixels in its block, as described in the constructor
  74.        above.
  75.  
  76.      void SetSpacing(short)
  77.        Set the spacing used between characters in a string.
  78.  
  79. SEE ALSO
  80.      FastCounter, Screen, DoubleBuffer
  81.  
  82. BUGS
  83.      No range checking is performed.
  84.  
  85. AUTHOR
  86.      Warwick Allison, Christmas 1992.
  87.      warwick@cs.uq.oz.au
  88.  
  89. COPYING
  90.      This functionality is part of the Atari Machine Specific Library,
  91.      and is Copyright 1992 by Warwick W. Allison.
  92.  
  93.      The Atari Machine Specific Library is free and protected under the
  94.      GNU Library General Public License.
  95.  
  96.      You are free to copy and modify these sources, provided you acknowledge
  97.      the origin by retaining this notice, and adhere to the conditions
  98.      described in the GNU LGPL.
  99.